package com.youxue.dao;

import com.youxue.entity.Order;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderMapper {
    int deleteByPrimaryKey(Integer orderId);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer orderId);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    int updateOrderStatus(Integer orderId);

    int updateOrderStatusPlus(Integer orderId);

    List<Order> selectAUserAllOrder(@Param(value = "userId") Integer userId,
                                    @Param(value = "orderStatus") Integer orderStatus);

    List<Order> selectAUserAllOrders(@Param(value = "userId") Integer userId);

    Order selectAOldOrderInfo(Integer orderId);

    Order selectANowOrderInfo(@Param(value = "userId") Integer userId);

    Order selectAOrder(@Param(value = "userId") Integer userId, @Param(value = "classId") Integer classId);

    Order selectAOrderInfo(@Param(value = "userId") Integer userId, @Param(value = "classId") Integer classId);

    Order selectAOrderNo(@Param(value = "userId") Integer userId, @Param(value = "classId") Integer classId);

    List<Order> selectAUserBuyClassByOrder(@Param(value = "userId") Integer userId);

    //将状态改为未支付
    int updateAOrderRollback(Integer orderId);

    //通过orderId修改ClassCondition=0
    int updateAOrderClassCondition(Integer orderId);
}